<template>
  <el-dialog title="设备摄像头" v-model="visible" width="640px" @close="onClose">
    <iframe
      class="camera-box"
      :src="src"
      width="600"
      height="400"
      id="ysOpenDevice"
      allowfullscreen
    >
    </iframe>
  </el-dialog>
</template>
<script setup>
import { getSerialNumberApi } from '@/api/device'

const visible = ref(false)
const src = ref('')
function init(serialNumber) {
  visible.value = true
  console.log({ serialNumber })
  getSerialNumberApi(serialNumber).then((res) => {
    console.log({ res })
    src.value = res.data
  })
}
function onClose() {
  src.value = ''
}
defineExpose({
  init
})
</script>
<style lang="scss" scoped>
// .camera-box {
//   margin-top: 50px;
//   transform: rotate(90deg);
//   height: 600px;
// }
</style>
